package roborally.script;

import roborally.model.Robot;

import be.kuleuven.cs.som.annotate.*;
import be.kuleuven.cs.som.taglet.*;

/**
 * @author Joren VERSPEURT
 * @author Mathieu REYMOND
 * @version 3.0
 * 
 * The superclass for all commands possible in RoboRally. This includes ComposedCommands and SingleCommands.
 */
public abstract class Command extends Statement {
	
	/**
	 * Create a new Command with a given Robot.
	 * @param robot The Robot this Command will apply to.
	 */
	protected Command(Robot robot){
		super(robot);
		executed = false;
	}
	
	/**
	 * A method to execute one step of this Command.
	 */
	public abstract void step();
	
	/**
	 * Check if the Command has already been fully executed.
	 * @return Whether the command has already been fully executed.
	 */
	@Basic
	public boolean isExecuted(){
		return executed;
	}
	
	/**
	 * Set the executed state of this Command to <code> state </code>.
	 * @param state The state to set this Command's state to.
	 */
	@Basic
	public void setExecuted(boolean state){
		executed = state;
	}
	
	/**
	 * Whether the command has already been fully executed.
	 */
	protected boolean executed;

}
